package com.sjzsqjy.asdtiang.mysql;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.hibernate.annotations.GenericGenerator;

/**
 * InfoType entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "info_type", catalog = "hospital", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
public class InfoType implements java.io.Serializable {

	// Fields

	private String id;
	private Long version;
	private String name;
	private Integer sequence;
	private Boolean image;
	private Boolean indexShow;
	private Set<Info> infos = new HashSet<Info>(0);
	private Set<Info> infos_1 = new HashSet<Info>(0);

	// Constructors

	/** default constructor */
	public InfoType() {
	}

	/** minimal constructor */
	public InfoType(Long version, String name) {
		this.version = version;
		this.name = name;
	}

	/** full constructor */
	public InfoType(Long version, String name, Integer sequence, Boolean image,
			Boolean indexShow, Set<Info> infos, Set<Info> infos_1) {
		this.version = version;
		this.name = name;
		this.sequence = sequence;
		this.image = image;
		this.indexShow = indexShow;
		this.infos = infos;
		this.infos_1 = infos_1;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "version", nullable = false)
	public Long getVersion() {
		return this.version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}

	@Column(name = "name", unique = true, nullable = false)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sequence")
	public Integer getSequence() {
		return this.sequence;
	}

	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}

	@Column(name = "image")
	public Boolean getImage() {
		return this.image;
	}

	public void setImage(Boolean image) {
		this.image = image;
	}

	@Column(name = "index_show")
	public Boolean getIndexShow() {
		return this.indexShow;
	}

	public void setIndexShow(Boolean indexShow) {
		this.indexShow = indexShow;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "infoType")
	public Set<Info> getInfos() {
		return this.infos;
	}

	public void setInfos(Set<Info> infos) {
		this.infos = infos;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "info_type_info", catalog = "hospital", joinColumns = { @JoinColumn(name = "info_type_info_id", updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "info_id", updatable = false) })
	public Set<Info> getInfos_1() {
		return this.infos_1;
	}

	public void setInfos_1(Set<Info> infos_1) {
		this.infos_1 = infos_1;
	}

}